package com.kcst.configurelayoutproject;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;


import com.kcst.configure.ConfigureActivity;
import com.kcst.configure.ConfigureManager;

import java.util.Map;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


    }

    public void jumpActivity(View view){
        ConfigureActivity.startConfigureActivity(MainActivity.this);
    }

    public void getContentValue(){
        String fieldsValue = ConfigureManager.getInstance().getFieldsValue(ConfigConstant.NAME);
        Log.i("configure", "ConfigConstant.NAME: " + fieldsValue);
    }

    @Override
    protected void onResume() {
        super.onResume();
        Map<String, String> allFieldsValues = ConfigureManager.getInstance().getAllFieldsValues();
        for (String s : allFieldsValues.keySet()) {
            Log.i("configure", "fields="+s+ "    value="+allFieldsValues.get(s));
        }
    }
}